<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
var a1= parseInt(prompt("请输入一个正整数："))
var a2=a1
for(var i=a2-1;i>0;i--){
var a2=a2*i
}
document.write(a1+"的阶乘是"+a2);
</script>
</html>